package xzl.edu.cn.set.animal;

import java.util.ArrayList;
import java.util.Iterator;

import org.apache.logging.log4j.Logger;

import org.apache.logging.log4j.LogManager;

public class DogManager {
	ArrayList<Dog> dogs = new ArrayList<Dog>();
	Logger logger = LogManager.getLogger(DogManager.class);

	public void add() {
		Dog dog1 = new Dog("Alice", "blue", 510.1);
		Dog dog2 = new Dog("Bob", "yellow", 610.2);
		Dog dog3 = new Dog("cc", "dark", 710.3);
		dogs.add(dog1);
		dogs.add(dog2);
		dogs.add(dog3);
	}

	public void show() {
		Iterator<Dog> it = dogs.iterator();
		while (it.hasNext()) {
			Dog dog = it.next();
			logger.info(dog.getName()+" is "+dog.getColor()+" of "+dog.getPrice());
		}
	}

}
